import Vue from "vue";
import VueRouter from "vue-router";
import Home from '../views/Home.vue';
import Login from '../views/Login.vue';
import Register from '../views/Register.vue';
import Index from "../views/Index.vue";
import Setting from '../views/Setting.vue'
import Page404 from "../views/Page404";
import Course from "../views/Course";
import Submit from '../views/Submit.vue';

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "Home",
    component: Home
  },

  {
    path: "/index",
    name: "Index",
    component: Index
  },

  {
    path: "/login",
    name: "Login",
    component: Login
  },

  {
    path: "/Register",
    name: "Register",
    component: Register
  },

  {
    path: "/Setting",
    name: "Setting",
    component: Setting
  },

  {
    path: "*",
    name: Page404,
    component: Page404
  },

  {
    path: "/course",
    name: Course,
    component: Course
  },

  {
    path: "/submit",
    name: Submit,
    component: Submit
  }

];

const router = new VueRouter({
  mode: 'history',   // 去除哈希路由
  routes
});

export default router;
